<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>按键修饰符</title>
  <script src="../vue.js"></script>
</head>

<body>
  <div id="app">
    <input v-model="username" @keyup.enter="btn" type="text" name="" id="">
    <div class="box">{{username}}</div>
  </div>
  <script>
    const app = new Vue({
      el: '#app',
      data: {
        username: ""
      },
      methods: {
        btn() {
          // console.log(this.username);
          const box = document.querySelector('.box')
          // box.innerHTML = this.username
        }
      }
    })
  </script>
</body>

</html>